t <- 0:255

s1 <- 2*sin(2*pi*30*t/256)
s2 <- 5*sin(2*pi*20*t/256)
s3 <- 10*sin(2*pi*8*t/256)
s4 <- rep(20,256)
s5 <- 50*sin(2*pi*1*t/256)
s15 <- s1+s2+s3+s4+s5

ffts1 <- fft(s1)
ffts2 <- fft(s2)
ffts3 <- fft(s3)
ffts4 <- fft(s4)
ffts5 <- fft(s5)

plot(t,s1,type="l",ylim=c(-10,30))
lines(t, s2, col="green")
lines(t, s3, col="red")
lines(t, s4, col="blue")
lines(t, s5, col="yellow")
